package export.monster
{
	import base.BaseAddEffect;
	
	
	import export.bullet.SpecialEffectBullet;
	
	public class Monster308 extends BaseMonster
	{
		public function Monster308()
		{
			super();
			this.attackBackInfoDict["hit1"] = {
				"hitMaxCount":30,
				"attackBackSpeed":[6,-5],
				"attackInterval":999,
				"attackKind":"physics"
			};
			this.attackBackInfoDict["hit2"] = {
				"hitMaxCount":30,
				"attackBackSpeed":[10,-2],
				"attackInterval":999,
				"powerTimes":3,
				"attackKind":"magic"
			};
			this.attackBackInfoDict["hit3"] = {
				"hitMaxCount":40,
				"attackBackSpeed":[0,0],
				"attackInterval":999,
				"powerTimes":2,
				"addEffect":[{
					"name":BaseAddEffect.ICE,
					"time":gc.frameClips * 5,
					"power":0
				}],
				"attackKind":"magic"
			};
			this.attackBackInfoDict["hit4"] = {
				"hitMaxCount":30,
				"attackBackSpeed":[20,-20],
				"attackInterval":999,
				"attackKind":"magic"
			};
			this.setAction("idle");
		}
		
		override protected function beforeSkill1Start():Boolean
		{
			return this.hasTarget() && AUtils.GetDisBetweenTwoObj(this, this.curAttackTarget) < 300;
		}
		
		override protected function beforeSkill2Start():Boolean
		{
			return this.hasTarget() && AUtils.GetDisBetweenTwoObj(this,this.curAttackTarget) < 450;
		}
		
		override protected function beforeSkill3Start():Boolean
		{
			return this.hasTarget();
		}
		
		override protected function releSkill1():void
		{
			this.setAction("hit2");
		}
		
		override protected function releSkill2():void
		{
			this.setAction("hit3");
		}
		
		override protected function releSkill3():void
		{
			this.setAction("hit4");
		}
		
		override public function isAttacking():Boolean
		{
			return this.curAction == "hit1" || this.curAction == "hit2" || this.curAction == "hit3" || this.curAction == "hit4";
		}
		
		public function dragonOut():void
		{
			if (Boolean(this.standInObj) && this.hasTarget())
			{
				var bb:SpecialEffectBullet = new SpecialEffectBullet("Monster305Bullet3");
				bb.x = this.curAttackTarget.x;
				bb.y = 510;
				bb.setOwner(this);
				bb.setDirect(this.isLeft ? 0 : 1);
				bb.setAction("hit4");
				gc.gameScene.addChild(bb);
				this.magicBulletArray.push(bb);
			}
		}
		
		override protected function myIntelligence():void
		{
			if(!this.isAttacking())
			{
				super.myIntelligence();
			}
		}
	}
}